<template>
  <div class="now-time">{{ dateYear }} {{ dateDay }}</div>
</template>

<script setup>
import dayjs from 'dayjs'
import { ref, onUnmounted } from 'vue'
const dateYear = ref('')
const dateDay = ref('')

const timer = setInterval(() => {
  const date = dayjs(new Date())
  dateYear.value = date.format('YYYY.MM.DD')
  dateDay.value = date.format('HH:mm')
}, 1000)
onUnmounted(() => {
  clearInterval(timer)
})
</script>

<style scoped lang="less">
.now-time {
  font-size: 16px;
  font-family: Source Han Sans CN-Medium, Source Han Sans CN;
  font-weight: 500;
  color: #666666;
  margin-right: 60px;
}
</style>
